<template>
	<view class="flex-col page">
		<view class="flex-col group_1">
			<view class="flex-col section_1">
				<uni-collapse accordion>
					<uni-collapse-item :title="item.title" v-for="(item, index) in help" :key="index">
						<u-parse :content="item.info"></u-parse>
					</uni-collapse-item>
				</uni-collapse>
			</view>

			<view class="" v-show="isOver">
				<u-loadmore :status="status" />
			</view>
		</view>
	</view>
</template>

<script>
	import {
		helpCenter
	} from '../../api/api.js'
	export default {
		components: {},
		data() {
			return {
				help: [],
				pageNum: 1,
				pageSize: 10,
				isOver: false, //用来显示显隐提示语 isOver 默认值false
				status: 'loading',
				show: false
			};
		},
		//下拉到底部后加载新数据
		onReachBottom() {
			this.isOver = true;
			this.pageNum++; //页数加一
			this.getList(); //回调接口
		},
		created() {
			this.getList()
		},
		methods: {
			getList() {
				const data = {
					type: 1,
					pageNum: this.pageNum,
					pageSize: this.pageSize
				}
				helpCenter(data).then(res => {
					const count = res.total
					if (this.help.length === count) {
						this.status = 'nomore'
						return
					}

					this.help = [...this.help, ...res.rows]
				})

				// const data = {
				// 	type: 1
				// }
				// helpCenter(data).then(res => {
				// 	if (res.data.length > 0) {
				// 		this.help = res.data
				// 	} else {
				// 		this.help = "暂无信息！"
				// 	}
				// })
			}
		},
	};
</script>

<style scoped lang="css">
	.group_2 {
		padding: 0.94rem 0 0.91rem 0.063rem;
		border-bottom: solid 0.031rem #e5e5e5;
	}

	.image_3 {
		margin-top: 0.28rem;
		width: 0.28rem;
		height: 0.53rem;
	}

	.text_1 {
		color: #666666;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		line-height: 0.84rem;
	}

	.page {
		background-color: #f5f5f5;
		border-bottom: solid 0.28rem #ffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group_1 {
		padding: 0.91rem 0 23.19rem;
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.section_1 {
		margin-left: 0.97rem;
		margin-right: 0.91rem;
		padding-left: 1.03rem;
		padding-right: 0.97rem;
		background-color: #ffffff;
		border-radius: 0.47rem;
	}

	.group_3 {
		padding: 0.94rem 0 0.91rem;
		border-bottom: solid 0.031rem #e5e5e5;
	}

	.group_4 {
		padding: 0.94rem 0 0.91rem 0.094rem;
		border-bottom: solid 0.031rem #e5e5e5;
	}

	.group_5 {
		padding: 0.92rem 0 0.92rem 0.063rem;
	}

	.text_3 {
		color: #666666;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		line-height: 0.84rem;
	}

	.text_5 {
		color: #666666;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		line-height: 0.84rem;
	}

	.text_6 {
		color: #666666;
		font-size: 0.88rem;
		font-family: SourceHanSansCN;
		line-height: 0.84rem;
	}
</style>
